from mongoengine import DynamicDocument
from mongoengine.fields import DateTimeField, FileField, IntField, ReferenceField, StringField


class File(DynamicDocument):
    meta = {'collection': 'file'}

    c_name = StringField()
    c_version = IntField()
    c_size = IntField()
    c_url = StringField()

    create_user = ReferenceField('User')
    create_time = DateTimeField()
    update_user = ReferenceField('User')
    update_time = DateTimeField()

    file_stream = FileField()
